Lucid and Efficient Case Analysis

نویسندگان

  • ULFAR ERLINGSSON
  • MUKKAI KRISHNAMOORTHY
چکیده

This paper describes a new scheme for building static search trees, using multiway radix search trees. We present this method for code generation of switch statements in imperative languages. We show that, for sparse case sets, the method produces faster code on average than existing methods, requiring O(1) time with a small constant for the average search. We then apply this method to the problem of code generation for generic functions in object-oriented languages, and nd that its use improves clarity as well as eeciency. 1. Introduction Switch statements in C, like case statements in Pascal and Ada, are useful conditional control constructs. These statements represent multiway tree control structures , whereas if statements represent binary tree control structures. In this paper we present a new code generation method for switch statements, which on the average generates faster code for sparse sets of cases than existing methods, and apply it to generic function dispatch in object-oriented languages. The method can be thought of as generating a multiway radix search tree on the case labels, and is referred to as the MRST method throughout this paper. Although the MRST method is appropriate for most searches where a static search tree can be generated, only its application to switch statements is considered here. There has been considerable work in the past ((8], 5], 2], 3] and 6]) regarding the Pascal case statement and code generation. Generating code for switch statements is discussed in 4] and 9]. A scheme similar to MRST, but restricted to binary radix search trees, can be found in 7]. We begin, in section 2, by describing the MRST method of code generation for switch statements. In section 3, we compare it with four other code generation methods. We analyze the methods in terms of storage requirements and time, providing the worst case and expected case scenarios for each method. We then perform an empirical study of the MRST method with a few representative examples. Finally, in section 5, we present an implementation mechanism for generic functions in object-oriented languages which exploits the properties of our MRST method.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

ویژگی‎های روان‎سنجی پرسش‎نامه رؤیای شفاف در دانشجویان دانشگاه سمنان

Objectives: The aim of the present study was to evaluate the psychometric properties of Lucid Dream Questionnaire in a sample of Semnan University students. Method: The population consisted of all the students of Semnan University in 2014-2015 academic year. The sample included 350 students selected by stratified random sampling method. All participants completed Lucid Dream Questionnaire, Catt...

متن کامل

Encoding Forensic Multimedia Evidence from MARF Applications as Forensic Lucid Expressions

In this work we summarize biometric evidence as well as file type evidence extraction “exported” as formal Forensic Lucid language expression in the form of higher-order intensional contexts for further case analysis by a system that interprets Forensic Lucid expressions for claim verification and event reconstruction. The digital evidence is exported from the Modular Audio Recognition Framewor...

متن کامل

Multidimensional Lucid: Design, Semantics and Implementation

We develop an eductive algorithm for the efficient implementation of Multidimensional Lucid, which includes dimensions as first-class values. By focusing on simple multi-dimensional expressions, we develop a series of operational semantics, ultimately leading to an algorithm that should lead to efficient implementations of Lucid for a variety of physical architectures.

متن کامل

Reasoning About a Simulated Printer Case Investigation with Forensic Lucid (abstract)

In this work we model the ACME (a fictitious company name) “printer case incident” and make its specification in Forensic Lucid, a Lucidand intensional-logic-based programming language for cyberforensic analysis and event reconstruction specification. The printer case involves a dispute between two parties that was previously solved using the finite-state automata (FSA) approach, and is now re-...

متن کامل

Integrating information of the efficient and anti-efficient frontiers in DEA analysis to assess location of solar plants: A case study in Iran

The solar photovoltaic (PV) energy is one of the most promising sources of energy, which has attracted many interests. Itis potentially the largest source of energy in the world and is capable to mitigategreenhouse gas (GHG) emissions significantly in comparison with fossil fuels.Location optimization of solar plants can play a vital role to rise the efficiency and performance of the solar PV s...

متن کامل

Lucid dreaming incidence: A quality effects meta-analysis of 50years of research.

We report a quality effects meta-analysis on studies from the period 1966-2016 measuring either (a) lucid dreaming prevalence (one or more lucid dreams in a lifetime); (b) frequent lucid dreaming (one or more lucid dreams in a month) or both. A quality effects meta-analysis allows for the minimisation of the influence of study methodological quality on overall model estimates. Following sensiti...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995